#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n,cnt1=0,cnt2=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(a[i]==1)cnt1++;
        if(a[i]==2)cnt2++;
    }
    cout<<max(cnt1,cnt2)<<endl;
    return 0;
}
